package gui;

import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;

import javax.swing.JFrame;

import agent.GUIAgent;

public class MainFrame extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8530160008200482027L;
	private MainPanel mainPanel;
	private ArrayList<Rectangle2D> buildings;
	private ArrayList<Line2D> roads;
	private GUIAgent guiAgent;
	
	public MainFrame() {
		super();
		build();
	}
	public MainFrame(GUIAgent guiAgent, ArrayList<Rectangle2D> buildings,ArrayList<Line2D> roads) {
		super();
		this.guiAgent = guiAgent;
		this.buildings = buildings;
		this.roads = roads;
		build();
	}

	private void build() {
		setTitle("Map"); 
		setSize(1000,800);
		setLocationRelativeTo(null);
//		setResizable(false);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setContentPane(buildContentPane());
		//System.out.println(mainPanel.getX()+","+mainPanel.getY()+","+mainPanel.getHeight()+","+mainPanel.getWidth());
		
}

	private MainPanel buildContentPane() {
		mainPanel = new MainPanel(guiAgent, buildings, roads);
		return mainPanel;
	}
	
	public MapComponent getMapContainer(){
		return mainPanel.getMapView();
	}
}
